﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace SBlogCore.Common.DispatchProxyIn
{
    /// <summary>
    /// 动态代理类
    /// </summary>
    [SkipScan]
    public class DynamicProxy
    {
        /// <summary>
        /// 创建动态代理
        /// </summary>
        /// <typeparam name="T">接口</typeparam>
        /// <typeparam name="TProxy">代理实现类</typeparam>
        /// <returns></returns>
        public static T Create<T, TProxy>()
            where TProxy : GlobalDispatchProxy
            where T : IGlobalDispatchProxy
        {
            T proxy = DispatchProxy.Create<T, TProxy>();
            return proxy;
        }
    }
}
